<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page import="com.zhengqiangblog.blog.model.Pagination"%>
<div class="pagination">
	<%
		Pagination pagination = (Pagination) request.getAttribute("pagination");
		int pageNo = pagination.getPageNo();
		int totalPages = pagination.getTotalPages();
		int totalItems = pagination.getTotalItems();
		if (totalPages > 1) {
			out.write("<ul>\n");
			for (int i = 1; i <= totalPages; i++) {
				if (i == pageNo) {
					out.write("<li><a href=\"?page=" + i + "\" class=\"curr\">" + i + "</a></li>\n");
				} else {
					out.write("<li><a href=\"?page=" + i + "\">" + i + "</a></li>\n");
				}
			}
			out.write("</ul>\n");
		}
	%>
</div>